package com.practice.LocalDateTime和ZonedDateTime等java8中全新的时间API相关操作;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;

/**
 * @program: tenghw-practice-demo
 * @author: tenghw
 * @create: 2024-01-14 16:29
 * @Version 1.0
 * @description:
 **/
public class Demo2 {
    public static void main(String[] args) {
        //年范围为1900-2900；月范围为1-12；日范围为1-31；时范围为0-23；分钟范围为0-59；秒范围为0-59)
        // 1. 指定时间
        LocalTime localTime = LocalTime.of(14, 10, 06);
        System.out.println(localTime);
        // 2. 指定日期
        LocalDate localDate = LocalDate.of(2024, 01, 14);
        System.out.println(localDate);
        // 3. 指定日期时间
        LocalDateTime localDateTime = LocalDateTime.of(2024, 01, 14, 14, 10, 06);
        System.out.println(localDateTime);

    }

}